//
//  RootViewController.m
//  ShouKuang
//
//  Created by CodeYY on 2019/5/29.
//  Copyright © 2019 CodeYY. All rights reserved.
//

#import "RootViewController.h"
#import "ShouKuanJiLuViewController.h"// 收款记录
#import "OrderViewController.h"
#import "ShangHaoGuanLiViewController.h"
#import "CheXiaoViewController.h"
#import "TianJiaShangHuHaoViewController.h"
#import "MoKuaiGuanLiViewController.h"
#import "ImagePreView.h"
@interface RootViewController ()

@end



@implementation RootViewController

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
}
-(void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
    self.navigationController.navigationBar.hidden = NO;

}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    __weak typeof(self) weakSelf = self;
//    // 备注
//    UIButton *beizhuBtn = [UIButton buttonWithType:UIButtonTypeSystem];
//    [beizhuBtn setTitle:@"备注" forState:UIControlStateNormal];
//    [self.view addSubview:beizhuBtn];
//    [beizhuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.centerX.offset(0);
//        make.top.offset(100);
//    }];
//    [[beizhuBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
//        ShouKuanJiLuViewController *vc = [ShouKuanJiLuViewController new];
//        [weakSelf.navigationController pushViewController:vc animated:YES];
//    }];
//
//

    
    // 订单详情
    UIButton *dingdanDetailBtn = ({
        UIButton *dingdanDetailBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [dingdanDetailBtn setTitle:@"订单列表" forState:UIControlStateNormal];
        [self.view addSubview:dingdanDetailBtn];
        [dingdanDetailBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0);
            make.top.offset(100);
        }];
        [[dingdanDetailBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
            OrderViewController *vc = [OrderViewController new];
            [weakSelf.navigationController pushViewController:vc animated:YES];
        }];
        dingdanDetailBtn;
    });
    
    // 收款记录
    UIButton *shoukuanjilvBtn = ({
        UIButton *shoukuanjilvBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [shoukuanjilvBtn setTitle:@"收款记录" forState:UIControlStateNormal];
        [self.view addSubview:shoukuanjilvBtn];
        [shoukuanjilvBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0);
            make.top.equalTo(dingdanDetailBtn.mas_bottom).offset(20);
        }];
        [[shoukuanjilvBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
            ShouKuanJiLuViewController *vc = [ShouKuanJiLuViewController new];
            [weakSelf.navigationController pushViewController:vc animated:YES];
        }];
        shoukuanjilvBtn;
    });
    
        // 商号管理
        UIButton *chexiaoBtn = ({
            UIButton *chexiaoBtn = [UIButton buttonWithType:UIButtonTypeSystem];
            [chexiaoBtn setTitle:@"商号管理" forState:UIControlStateNormal];
            [self.view addSubview:chexiaoBtn];
            [chexiaoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerX.offset(0);
                make.top.equalTo(shoukuanjilvBtn.mas_bottom).offset(20);
            }];
            [[chexiaoBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
                ShangHaoGuanLiViewController *vc = [ShangHaoGuanLiViewController new];
                [weakSelf.navigationController pushViewController:vc animated:YES];
            }];
            chexiaoBtn;
        });
    
    // 撤销
    UIButton *fiveBtn = ({
        UIButton *fiveBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [fiveBtn setTitle:@"撤销" forState:UIControlStateNormal];
        [self.view addSubview:fiveBtn];
        [fiveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0);
            make.top.equalTo(chexiaoBtn.mas_bottom).offset(20);
        }];
        [[fiveBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
            CheXiaoViewController *vc = [CheXiaoViewController new];
            [weakSelf.navigationController pushViewController:vc animated:YES];
        }];
        fiveBtn;
    });
    // 撤销
    UIButton *tianjiashanghuhaoBtn = ({
        UIButton *tianjiashanghuhaoBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [tianjiashanghuhaoBtn setTitle:@"添加商户号" forState:UIControlStateNormal];
        [self.view addSubview:tianjiashanghuhaoBtn];
        [tianjiashanghuhaoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0);
            make.top.equalTo(fiveBtn.mas_bottom).offset(20);
        }];
        [[tianjiashanghuhaoBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
            TianJiaShangHuHaoViewController *vc = [TianJiaShangHuHaoViewController new];
            [weakSelf.navigationController pushViewController:vc animated:YES];
        }];
        tianjiashanghuhaoBtn;
    });
    
    // 撤销
    UIButton *mokuaiguanliBtn = ({
        UIButton *mokuaiguanliBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [mokuaiguanliBtn setTitle:@"模块管理员" forState:UIControlStateNormal];
        [self.view addSubview:mokuaiguanliBtn];
        [mokuaiguanliBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0);
            make.top.equalTo(tianjiashanghuhaoBtn.mas_bottom).offset(20);
        }];
        [[mokuaiguanliBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
            MoKuaiGuanLiViewController *vc = [MoKuaiGuanLiViewController new];
            [weakSelf.navigationController pushViewController:vc animated:YES];
        }];
        mokuaiguanliBtn;
    });
    
    // 弹出图片视图
    UIButton *shibuBtn = ({
        UIButton *shibuBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [shibuBtn setTitle:@"图片预览" forState:UIControlStateNormal];
        [self.view addSubview:shibuBtn];
        [shibuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0);
            make.top.equalTo(mokuaiguanliBtn.mas_bottom).offset(20);
        }];
        [[shibuBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
            [ImagePreView imagePreView:@"moren" titleStr:@"备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注"];
        }];
        shibuBtn;
    });
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
